package com.erp.entity.information;

import java.util.Objects;

//以下是实体类
public class Permission  {
    private Integer permissionId;
    private String permissionName;
    private String url;
    private String code;
    private Integer parentId;
    private Integer type;


    public Permission() {
    }

    public Permission(Integer permissionId, String permissionName, String url, String code, Integer parentId, Integer type) {
        this.permissionId = permissionId;
        this.permissionName = permissionName;
        this.url = url;
        this.code = code;
        this.parentId = parentId;
        this.type = type;
    }

    /**
     * 获取
     * @return permissionId
     */
    public Integer getPermissionId() {
        return permissionId;
    }

    /**
     * 设置
     * @param permissionId
     */
    public void setPermissionId(Integer permissionId) {
        this.permissionId = permissionId;
    }

    /**
     * 获取
     * @return permissionName
     */
    public String getPermissionName() {
        return permissionName;
    }

    /**
     * 设置
     * @param permissionName
     */
    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    /**
     * 获取
     * @return url
     */
    public String getUrl() {
        return url;
    }

    /**
     * 设置
     * @param url
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * 获取
     * @return code
     */
    public String getCode() {
        return code;
    }

    /**
     * 设置
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * 获取
     * @return parentId
     */
    public Integer getParentId() {
        return parentId;
    }

    /**
     * 设置
     * @param parentId
     */
    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    /**
     * 获取
     * @return type
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置
     * @param type
     */
    public void setType(Integer type) {
        this.type = type;
    }

    public String toString() {
        return "Permission{permissionId = " + permissionId + ", permissionName = " + permissionName + ", url = " + url + ", code = " + code + ", parentId = " + parentId + ", type = " + type + "}";
    }


    //重写对应的去重方法

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Permission that = (Permission) o;
        return Objects.equals(permissionId, that.permissionId); // 只用id判断
    }

    @Override
    public int hashCode() {
        return Objects.hash(permissionId);
    }
}
